<?php defined('SYSPATH') or die('No direct script access.'); 
define("MAXITEMS", 15);?>
<?php 
$min = $page*MAXITEMS;
$max = ($page+1)*MAXITEMS;
$count = 0;?>
<div class="center_content">
	<div class="center_title_bar"><?php echo $title ?></div>
	 <?php foreach($items as $item): ?>
		<?php if (($count >= $min) && ($count < $max)):?>
		<div class="prod_box_big">
			<div class="center_prod_box_big">
				<div class="product_img_big">			
					<?php echo Html::Image('images/'.$item->image->filename, array('width'=>180, 'height'=>140)); ?>
				</div>
				<div class="details_box_big">
					<div class="specifications">
						<div class="product_title_big">						
							<?php echo HTML::anchor('item/item/sitem/'.$item->id, $item->name, array('class'=>'product_title_big')); ?>
						</div>
						<?php echo 'Price: '.$item->price; ?><br><br>
					</div>
				</div>
			</div>
		</div>
		<?php endif; ?>
		<?php $count++; ?>
	 <?php endforeach; ?>
 </div>
 

 
 <?php if($page == 0):?>
	<?php if($itemcount > $max): ?>
		<?php echo HTML::anchor('/item/item/viewsearch/'.($page+1),'Next Page'); ?>
	<?php else:?>
	<?php endif; ?>
<?php else: ?> 
	<?php if($itemcount < $max):?>
		<?php echo HTML::anchor('/item/item/viewsearch/'.($page-1),'Previous Page'); ?>
	<?php elseif($itemcount > $max): ?>
		<?php echo HTML::anchor('/item/item/viewsearch/'.($page-1),'Previous Page'); ?>
		<?php echo HTML::anchor('/item/item/viewsearch/'.($page+1),'Next Page'); ?>
	<?php endif; ?>
<?php endif; ?>